

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'student.label', default: 'Student')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    
    </head>
    <body>
        <div class="body">
            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${studentInstance}">
            <div class="errors">
                <g:renderErrors bean="${studentInstance}" as="list" />
            </div>
            </g:hasErrors>
     
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
            <span class="menuButton"><g:link class="list" action="classesStudents" controller="studentMgr" id="${params.id}"><g:message code="default.return.label"/><g:message code="default.list.label" args="[entityName]" /></g:link></span>
        </div>
            <g:form action="save" method="post" name="studentCreate">
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    
                                </td>
                                <td valign="top" >
                                    <span id="validName"></span>
                                </td>
                            </tr>
 
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name"><g:message code="student.name.label" default="Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: studentInstance, field: 'name', 'errors')}">
                                    <g:textField name="name" maxlength="50" value="${studentInstance?.name}" />
                                    
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="classes"><g:message code="student.classes.label" default="Classes" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: studentInstance, field: 'classes', 'errors')}">
                                    ${aClasses}
                                    <g:hiddenField name="classes.id" value="${aClasses.id}" />
                                    <g:hiddenField name="classesID" value="${aClasses.id}" />
                                 
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="sex"><g:message code="student.sex.label" default="Sex" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: studentInstance, field: 'sex', 'errors')}">
                                    <input type="radio" class="radio" name="sex" checked="checked" value="男" />男
                                    <input type="radio" class="radio" name="sex" value="女" />女
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="birthday"><g:message code="student.birthday.label" default="Birthday" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: studentInstance, field: 'birthday', 'errors')}">
                                    <g:textField name="birthday" value="" readonly="true"/>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="unit"><g:message code="student.address.label" default="Address" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: studentInstance, field: 'address', 'errors')}">
                                    <g:textField name="address" maxlength="250" value="${studentInstance?.address}" />
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="unit"><g:message code="student.post.label" default="Post" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: studentInstance, field: 'post', 'errors')}">
                                    <g:textField name="post" maxlength="10" value="${studentInstance?.post}" />
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="level"><g:message code="student.level.label" default="Level" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: studentInstance, field: 'level', 'errors')}">
                                    <g:lookupSelect id="level" name="level" realm="studentLevel" value="${studentLevel}"/>
                                </td>
                            </tr>


                           <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="state"><g:message code="student.state.label" default="State" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: studentInstance, field: 'state', 'errors')}">
                                    <g:checkBox class="checkbox" name="state" value="${studentInstance?.state}"/>
                                </td>
                            </tr>

                            <tr class="prop" id="sourceCtrl">
                                <td valign="top" class="name">
                                    <label for="source"><g:message code="student.source.label" default="Source" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: studentInstance, field: 'source', 'errors')}">
                                    <g:textArea name="source" cols="40" rows="5" value="${studentInstance?.source}" />
                                </td>
                            </tr>

                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                </div>
            </g:form>
        </div>
        <link rel="stylesheet" href="${resource(dir:'css',file:'ui-lightness/jquery-ui-1.8.custom.css')}" />
        <g:javascript src="jquery/jquery-ui-1.8.custom.min.js"/>
        <g:javascript src="jquery/jquery.ui.datepicker-zh-CN.js"/>
        <g:javascript src="validate/jquery.validate.js" type="text/javascript"/>
       <g:javascript src="domain/student_create.js" type="text/javascript"/>
 
    </body>
</html>
